package com.spring.student.lifecycle;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class LifecycleTest {
    public static void main(String[]args){
        ApplicationContext context;
        context = new ClassPathXmlApplicationContext("lifecycle.xml");

        Lifecycle lifecycle = (Lifecycle) context.getBean("lifecycle");
        lifecycle.print();
        ((AbstractApplicationContext)context).close();
    }
}